﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace AEA.RSSFeedReaderLib
{
    /// <summary>
    /// Provides data for the RSSFeed.DownLoadItemFeedCompleted event.
    /// </summary>
    public class DownLoadItemFeedCompletedEventArgs : EventArgs
    {
        /// <summary>
        /// Initalize a new instance of the DownLoadItemFeedCompletedEventArgs class.
        /// </summary>
        /// <param name="channel">The channel of feed.</param>
        /// <param name="itemFeeds">The collection of ItemFeeds.</param>
        /// <param name="error">Any error that occurred.</param>
        public DownLoadItemFeedCompletedEventArgs(ChannelFeed channel, ItemFeedCollection itemFeeds, Exception error)
        {
            Channel = channel;
            ItemFeeds = itemFeeds;
            Error = error;
        }

        /// <summary>
        /// Gets the collection of ItemFeeds.
        /// </summary>
        public ItemFeedCollection ItemFeeds { get; private set; }

        /// <summary>
        /// Gets the Channel with the ItemFeeds.
        /// </summary>
        public ChannelFeed Channel { get; private set; }

        /// <summary>
        /// Gets a value indicating which error occurred.
        /// </summary>
        public Exception Error { get; private set; }

        /// <summary>
        /// Gets the ChannelFeed Uri.
        /// </summary>
        public string ChannelUri
        {
            get
            {
                return Channel.ChannelUri;
            }
        }
    }
}
